package com.slz3.business.module.goodsManagement.gooAttribute.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.goodsManagement.gooAttribute.domain.GooAttribute;
import com.slz3.business.module.goodsManagement.gooAttribute.domain.GooAttributeCondition;
import org.springframework.stereotype.Component;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

@Component
public class GooAttributeResAtomic {

    public Mono<ServerResponse> add_$GooAttributeUpdateLock(ServerRequest req, GooAttribute gooAttribute) {
        return GooAttributeResSafeValid.add(req, gooAttribute) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                GooAttributeResExecutor.add(req, gooAttribute);
    }

    public Mono<ServerResponse> delete_$GooAttributeUpdateLock(ServerRequest req, GooAttributeCondition gooAttributeCondition) {
        return GooAttributeResSafeValid.delete(req, gooAttributeCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                GooAttributeResExecutor.delete(req);
    }

    public Mono<ServerResponse> modify_$GooAttributeUpdateLock(ServerRequest req, GooAttribute gooAttribute) {
        return GooAttributeResSafeValid.modify(req, gooAttribute) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                GooAttributeResExecutor.modify(req, gooAttribute);
    }

    public Mono<ServerResponse> info_$GooAttributeUpdateLock(ServerRequest req) {
        return GooAttributeResSafeValid.info(req) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                GooAttributeResExecutor.info(req);
    }

    public Mono<ServerResponse> auditSubmit_$GooAttributeUpdateLock(ServerRequest req, GooAttributeCondition gooAttributeCondition) {
        return GooAttributeResSafeValid.auditSubmit(req, gooAttributeCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                GooAttributeResExecutor.auditSubmit(req);
    }

    public Mono<ServerResponse> audit_$GooAttributeUpdateLock(ServerRequest req, GooAttributeCondition gooAttributeCondition) {
        return GooAttributeResSafeValid.audit(req, gooAttributeCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                GooAttributeResExecutor.audit(req);
    }

    public Mono<ServerResponse> auditReject_$GooAttributeUpdateLock(ServerRequest req, GooAttributeCondition gooAttributeCondition) {
        return GooAttributeResSafeValid.auditReject(req, gooAttributeCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                GooAttributeResExecutor.auditReject(req);
    }


    public Mono<ServerResponse> usingEnable_$GooAttributeUpdateLock(ServerRequest req, GooAttributeCondition gooAttributeCondition) {
        return GooAttributeResSafeValid.usingEnable(req, gooAttributeCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                GooAttributeResExecutor.usingEnable(req);
    }

    public Mono<ServerResponse> usingDisable_$GooAttributeUpdateLock(ServerRequest req, GooAttributeCondition gooAttributeCondition) {
        return GooAttributeResSafeValid.usingDisable(req, gooAttributeCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                GooAttributeResExecutor.usingDisable(req);
    }
}
